import Taro from "@tarojs/taro";
import interceptors from "./interceptors";
import http from "./http.js"

export const getOpenId= (jsCode)=>{
  return http.get("/api/sysWxOpen/wxOpenId",{jsCode:jsCode})
}

export const wxLogin = (openId) => {
  return http.post("/api/sysWxOpen/wxOpenIdLogin",{openId})
};

// type: 1首页 2房源页 3发现页
export const getBanner = (type) => {
  return http.get("/api/homeBanner/list",{type})
}

//获取房源信息分页
export const getHouseInfoPage = (page,pageSize) => {
  return http.post("/api/houseInfo/page",{pageSize,page})
}

// 获取设计案例
export const getDesignerCase = (page,pageSize) => {
  return http.post('/api/designerCase/page',{pageSize,page})
}

//热门推荐
export const getArticles= (page,pageSize) =>{
  return http.post('/api/articleInfo/page',{page,pageSize})
}

// 添加文章
export const addArticle = (article) =>{
  return http.post("/api/articleInfo/add",article)
}

export const getArticle= (id)=>{
  return http.get("/api/articleInfo/detail")
}
